home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / DELPHI / FDRAG10.ZIP / TESTDROP.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1996-04-10  |  952 b   |  50 lines

  1. unit testdrop;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   ComCtrls, filedrag;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     ListView1: TListView;
  12.     FileDrag1: TFileDrag;
  13.     procedure FileDrag1Drop(Sender: TObject);
  14.     procedure FormCreate(Sender: TObject);
  15.   private
  16.     { Private declarations }
  17.   public
  18.     { Public declarations }
  19.   end;
  20.  
  21. var
  22.   Form1: TForm1;
  23.  
  24. implementation
  25.  
  26. {$R *.DFM}
  27.  
  28. procedure TForm1.FileDrag1Drop(Sender: TObject);
  29. var
  30.    x: Integer;
  31.    item: TListItem;
  32. begin
  33.    x := 0;
  34.    while x < FileDrag1.FileCount do
  35.     begin
  36.        item := ListView1.Items.Add;
  37.        item.caption := FileDrag1.NameWithPath[x];
  38.        item.SubItems.Add( FileDrag1.NameOnly[x] );
  39.        item.SubItems.Add( FileDrag1.Extension[x] );
  40.        Inc( x );
  41.     end;
  42. end;
  43.  
  44. procedure TForm1.FormCreate(Sender: TObject);
  45. begin
  46.    FileDrag1.EnableDrop := True;
  47. end;
  48.  
  49. end.
  50.